package com.dk.controller;

import com.dk.service.LogService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @Deacription TODO
 * @Author Lenovo
 * @Date 2020/12/4 10:33
 * @Version 1.0
 **/
@Controller
public class LogController {

    @Autowired
    private LogService logService;

    private Logger logger = LoggerFactory.getLogger(LogController.class);

    @RequestMapping("log")
    @ResponseBody
    public String log(){
        logger.debug("1111");
        logger.info("2222");
        logger.warn("3333");
        logger.error("4444");

        logService.log();
        return "ok";
    }
}

